package com.sun.module_network

/**
 *@author:sunc
 *@time :2025/7/18 10:59
 *@desc: 接口返回实体
 *
 */
class HttpResult<T>(
    private val errorMsg: String,
    private val errorCode: Long,
    private val data: T?,
) : BaseResponse<T>() {

    override fun isSuccess(): Boolean {
        return errorCode == 0L
    }

    override fun getResponseData(): T? = data

    override fun getResponseCode(): Long = getCode()

    override fun getResponseMsg(): String = getMsg()

    private fun getCode(): Long = errorCode

    private fun getMsg(): String = errorMsg

}